<!DOCTYPE html>
<html>
<#include "../../common/header.ftl">
<script src="${basePath}/js/public/goodsList.js?time=201710251157"></script>
<head>
<meta charset="UTF-8">
<title>商品选择列表</title>
<style>
	.left{
		float:left;
		min-width:100px;
		margin-left: 10px;
	}
	.red_text{
		color:red;
	}
	.blue_text{
		color:blue;
	}
	.table-margin{
		margin:5px 3%;
		width:92%;
	}
</style>
</head>
<body>
   
<div class="container" style="margin-left:5%">
<form class="layui-form left" action="#" >
<div class="layui-form-item">
 <div class="layui-input-block left">
      <input type="text" name="keyword" value="${param.keyword!}"   placeholder="商品名称/款号" autocomplete="off" 
      class="layui-input" style="width:400px;margin-right:200px;margin-left:30px">
    </div>
     <div class="layui-input-block left">
      <button type="button" class="layui-btn"  id="search-button">搜索</button>
      <button type="button" class="layui-btn" id="save-button">保存</button>
    </div>
</div>
</form>
</div>

    <table class="table table-margin">
  <thead>
      <tr>
         <th><input type="checkBox" onclick="checkAll(this)"></th>
         <th>商品图片</th>
         <th>商品名称</th>
         <th>款式编码</th>
         <th>商品类型</th>
         <th>商品价格</th>
         <th>商品状态</th>
         <th>季度</th>
      </tr>
   </thead>
	<tbody>
	<#list page.itemList! as goods>
			
			<tr>
				<td><input type="checkbox" class="goods-checkbox" onclick="checkOne(this)" value="${goods.id!}" data-name="${goods.goodsName!}" data-image="${goods.coverImage!}" data-price="${goods.price?string('#0.00')}"></td>
				<td>
					<#if goods.coverImage??>
						<img  src="${imgUrl+goods.coverImage}" height="50px" width="50px" 
						 data-toggle="modal" data-target="#imgModal" onerror="this.src='${basePath}/images/default_goods.jpg'" />
					<#else>
						<img  src="${basePath}/images/default_goods.jpg" height="50px" width="50px"  data-toggle="modal" data-target="#imgModal"/> 
					</#if>
				</td>
				<td>${goods.goodsName!}</td>
				<td>${goods.styleCode!}</td>
				<td>${goods.typeName!}</td>
				<td>${goods.price?string('#0.00')}</td>
				<td><#if goods.goodsStatus?? && goods.goodsStatus == "sale">在售
					<#elseif goods.goodsStatus?? && goods.goodsStatus == "wait">待售中
					<#elseif goods.goodsStatus?? && goods.goodsStatus == "down"><span class="blue_text">已下架</span>
					<#else><span class="red_text">已删除</span>
					</#if></td>
				<td><#if goods.quarter?? && goods.quarter == 1>春
					<#elseif goods.quarter?? && goods.quarter == 2>夏
					<#elseif goods.quarter?? && goods.quarter == 3>秋
					<#elseif goods.quarter?? && goods.quarter == 4>冬
					<#else>未知
				    </#if>
				</td>
				<td>
			</tr>
	</#list>
	</tbody>
	</table>
 
	<#-- 翻页模块代码 -->
	<ul class="pager">
		<li><a href="javascript:void(0);" onclick="fanye('1')">首页</a></li>
		<#if page.pageNo!=1 > 
		<li><a	href="javascript:void(0);" onclick="fanye('${page.prevPage}')">上一页</a></li>
		<#else>
		<li><a href="javascript:void(0);">上一页</a></li> 
		</#if>
		<li><a href="javascript:void(0);">第${page.pageNo}页/共${page.totalPage}页</a></li>
		<#if (page.nextPage>page.pageNo) >
		<li><a href="javascript:void(0);" onclick="fanye('${page.nextPage}')">下一页</a></li>
		<#else>
		<li><a href="javascript:void(0);">下一页</a></li>
		</#if>
		<li><a href="javascript:void(0);" onclick="fanye('${page.totalPage}')">尾页</a></li>
	</ul>
  
</body>
<script type="text/javascript">
	var basePath="${basePath}";
	var init={
		keyword:"${param.keyword!}",
		chooseType:"${chooseType}"
	}
	$(function(){
		layui.use(['form', 'layer'], function(){
		  var layer = layui.layer;
		  var form = layui.form(); 
	});
  
});
</script>
</html>